package com.hmtech.ayp.common.s3.properties;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

/**
 * AWS配置
 *
 * @author 闫家洪（yanjiahong@vcredit.com）
 * @since 2023/12/18
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Component
@ConfigurationProperties("aws.s3")
public class AwsS3Properties {

    /**
     * 访问key
     */
    private String accessKeyId;

    /**
     * 密钥
     */
    private String accessSecretKey;

    /**
     * S3端点名
     */
    private String endpoint;

    /**
     * 存储桶名称
     */
    private String bucketName;

    /**
     * 区域
     */
    private String region;

    /**
     * 签名过期时间，单位秒，默认5分钟
     */
    private Long expireInSeconds = TimeUnit.MINUTES.toSeconds(5);

    /**
     * 临时上传角色ARN
     */
    private String tempS3PutRoleArn = "arn:aws:iam::383264643954:role/testrole";

}
